{template "topic_header"}
<link href="styles/theme.css" rel="stylesheet" type="text/css" />
<div class="appframe">
	<div class="appframeTitle">
		<span class="mleft">图片墙</span>
	</div>

	<div class="themepwarp">
		<div>
			<!--{loop $eventPicList $val}-->
			<img src="{$val[pic]}" height="250" width="250"></img>
	
			<!--{/loop}-->
		</div>



		<!--{if $eventInfo[postman]==MEMBER_ID}-->
		<div>

			<iframe id="uploadframe" name="uploadframe" width="0" height="0"
				marginwidth="0" frameborder="0" src="about:blank"
				style="display: none; z-index: 0;"></iframe>
			<form name="FORM" id="FORM" method="post" action=""
				enctype="multipart/form-data" target="uploadframe">
				<input type="hidden" id="eid" value="{$eid}">
				<table id="step2" align="left">
					<tr>
						<td><span>*</span>图片描述:<br> <input name="content1"
							id="content1" /></td>
					</tr>
					<tr>
						<td><span>*</span>上传活动图片： <input type="file" id="pic"
							name="pic" onchange="onloadPic();"> <sup id="message"
							style="display: none; color: #FF0000;"></sup> <sup id='uploading'
							style="display: none"><img src="images/loading.gif">图片正在上传中、请稍等...</sup>
							<sup id="hid_pic_tips" style="display: none; color: #FF0000;"></sup>
							<input type="hidden" id="hid_pic" name="hid_pic" value="{$image}">
						</td>
					</tr>
					<tr id="img" style="display: none">
						<td><img id="showimg" name="showimg" src="{$image}"
							height="90" width="100"></img></td>
					</tr>
					<tr>
						<td><input type="button" value="发布" onclick="save()"
							class="btnText" /></td>
					</tr>

				</table>
			</form>
		</div>
		<!--{/if}-->
		
		
		
		
	</div>
</div>
<script>
	function onloadPic() {
		var fn = $('#pic').val();
		if (!/.(gif|jpg|png|jpeg)$/i.test(fn)) {
			alert("请上传jpg、jpeg、gif、png格式的图片。");
			return false;
		}
		var top = $('#top').val();
		if (top == 'top') {
			document.getElementById('back1').style.display = 'none';
			document.getElementById('next3').style.display = 'none';
		}
		document.getElementById('uploading').style.display = 'block';
		document.FORM.target = "uploadframe";
		document.FORM.action = "ajax.php?mod=event&code=onloadEventPic";
		$('#FORM').submit();
	}
	function save() {
		$.post("index.php?mod=event&code=savePic", {
			"title" : $("#content1").val(),
			"pic" : $("#hid_pic").val(),
			"eid" : $("#eid").val()
		}, function(response) {
			if (response.status == 0) {
				alert(response.info);
			} else {
				location.reload();
			}
		});

	}
</script>
{template "topic_footer"}
